import React, { Component } from 'react'
import Cmp1 from './components/Cmp1'
import Cmp2 from './components/Cmp2'

// 统一的数据源
import { Provider } from './context/store'


// 只有在类组件中才有生命周期
export default class App extends Component {
  constructor(props) {
    super(props);
    this.state = {
      title: '你好世界'
    }
  }


  render() {

    return (
      <div>
        {/* 多层组件之间的通信 发布一下，子孙们，祖先有数据给你们 */}
        <Provider value={this.state.title}>
          <Cmp1 />
        </Provider>
      </div >
    )
  }

}
